<template>
  <div>
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>权限管理</el-breadcrumb-item>
      <el-breadcrumb-item>角色列表</el-breadcrumb-item>
    </el-breadcrumb>

    <el-card>
      <el-row>
        <el-col>
          <el-button type="primary">添加角色</el-button>
        </el-col>
        <el-col>
          <el-table :data="rolesList" border stripe>
              <el-table-column type="index"></el-table-column>
              <el-table-column prop="roleName" label="角色名称"></el-table-column>
              <el-table-column prop="roleDesc" label="角色描述"></el-table-column>
              <el-table-column label="操作"></el-table-column>
          </el-table>
        </el-col>
      </el-row>

      <el-table></el-table>
    </el-card>
  </div>
</template>
<script>
export default {
  data() {
    return {
      rolesList: {}
    }
  },
  created() {
    this.getRolesList()
  },
  methods: {
    async getRolesList() {
      const { data: res } = await this.$http.get('roles')
      if (res.meta.status !== 200) return this.$message.error(res.meta.status)
      this.rolesList = res.data
      console.log(this.rolesList)
    }
  }
}
</script>
<style lang="less" scoped>
</style>
